tests: Avoid musl failure with `cp -a`
authorAlex Kiernan <alex.kiernan@gmail.com>
Thu, 31 Oct 2019 17:09:36 +0000 (17:09 +0000)
committerAlex Kiernan <alex.kiernan@gmail.com>
Fri, 1 Nov 2019 05:05:53 +0000 (05:05 +0000)
When copying the tree, using musl and GNU coreutils, something gets confused
when setting the ownership of symlinks and the copy fails with:

  cp: failed to preserve ownership for osdata-devel/bin: Not supported

Rework using tar to avoid the problem.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
tests/libtest.sh
tests/test-admin-gpg.sh

index ba00073a10a787f51679db3cbdc1c3152c03baf2..3f5fd931bc1ebd97784006ef6baf5d69deab6bed 100755 (executable)
@@ -440,7 +440,9 @@ EOF
     ${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo commit --add-metadata-string version=1.0.10 -b testos/buildmaster/x86_64-runtime -s "Build"
 
     cd ${test_tmpdir}
-    cp -a osdata osdata-devel
+    rm -rf osdata-devel
+    mkdir osdata-devel
+    tar -C osdata -cf - . | tar -C osdata-devel -xf -
     cd osdata-devel
     mkdir -p usr/include
     echo "a development header" > usr/include/foo.h
index 1f50c8a9a508ab3f10372cf8403470f56c86a980..dc776743776cec72dbbb1c3b7f5d66e4e7b9f308 100755 (executable)
@@ -90,7 +90,9 @@ EOF
     ${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo commit --add-metadata-string version=1.0.10 -b testos/buildmaster/x86_64-runtime -s "Build" --gpg-sign=$keyid --gpg-homedir=${test_tmpdir}/gpghome
 
     cd ${test_tmpdir}
-    cp -a osdata osdata-devel
+    rm -rf osdata-devel
+    mkdir osdata-devel
+    tar -C osdata -cf - . | tar -C osdata-devel -xf -
     cd osdata-devel
     mkdir -p usr/include
     echo "a development header" > usr/include/foo.h